#!/usr/bin/env python
# Copyright (C) 2008 Marcin Cieslik <marcin.cieslik@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
import unittest
#NUMPY
from numpy.random import random
from numpy import array
from zenpdb.Math import sphere_points
from numpy import copy

class test_sorts(unittest.TestCase):
    def setUp(self):
        self.lcoords = random(300).reshape((100,3))
        self.lradii = random(10)
        self.qcoords = random(30).reshape((10,3))
        self.qradii = random(10)
        self.spoints = sphere_points(100)
        #self.spoints = array([[1.,2,3],[4,5,6],[7,8,9]])
#    def test_import(self):
#        from asa import asa_loop
#    def test_call(self):
#        from asa import asa_loop
#        a = asa_loop(self.qcoords,self.lcoords,self.qradii,self.lradii,self.spoints,1.4,10)
    def test_result(self):
        from asa import asa_loop
        self.lcoords = array([[-4.,0,0],[0,0,0],[4,0,0],[10,0,0]])
        self.qcoords = array([[0.,0,0],[4.,0,0]])
        self.lradii  = array([2., 3.])
        self.qradii  = array([3., 2.])
        self.spoints = array([[1.,0.,0.],[-1.,0.,0.],[0.,1.,0.],[0.,-1.,0.],[0.,0.,1.],[0.,0.,-1.]])
        print asa_loop(self.qcoords,self.lcoords,self.qradii,self.lradii,self.spoints,1.,10)
    def tearDown(self):
        pass

suite = unittest.makeSuite(test_sorts,'test')

if __name__ == "__main__":
    runner = unittest.TextTestRunner()
    runner.run(suite)
